home *** CD-ROM | disk | FTP | other *** search
/ 3D Images / 3D Images.iso / programs / amiga / rayshade / rayfiles / rsdefs / docs / objects.doc < prev    next >
Encoding:
Text File  |  1995-01-12  |  14.9 KB  |  451 lines

  1. Superprimitives
  2. ===============
  3.     All superprimitives take a "prefix" as their first argument.
  4. This allows the creation of a named object rather than an instance of the
  5. object.  For example, "RSPsoapbar(name suds, RSSsoap_light())" creates a
  6. soap bar named "suds" that can be called later with "object suds".  If the
  7. first argument is left empty, an instance is created.  For example,
  8. "RSPsoapbar(,RSSsoap_light())" creates an instance of the soapbar.
  9. All superprimitives can be called as instances within aggregate objects
  10. including CSG objects (however, not all objects are "closed" -- see CSG
  11. below).  All objects can be followed by transformation and texturing
  12. calls.
  13.  
  14. CSG -- Several of the superprimitives are "closed" under CSG rules.  The list
  15. of valid CSG objects can be found in Docs/CSG.
  16.  
  17.     The following superprimitives are defined:
  18.  
  19. RSPboxframe(prefix,x1,y1,z1,x2,y2,z2,r)            (rounded.rh)
  20. RSPchessboard(prefix,s1,s2,sc)                (chess.rh)
  21. RSPcube(prefix,surf)                    (regsolids.rh)
  22. RSPcylinder_board(prefix,s1,s2,sc)            (chess.rh)
  23. RSPdodecahedron(prefix,surf)                (regsolids.rh)
  24. RSPfont_A(prefix,t)                    (font.rh)
  25.     .
  26.     .
  27.     .
  28. RSPfont_Z(prefix,t)                    (font.rh)
  29. RSPfont_a(prefix,t)                    (font.rh)
  30.     .
  31.     .
  32.     .
  33. RSPfont_z(prefix,t)                    (font.rh)
  34. RSPfont_0(prefix,t)                    (font.rh)
  35.     .
  36.     .
  37.     .
  38. RSPfont_9(prefix,t)                    (font.rh)
  39. RSPfont_ampersand(prefix,t)                (font.rh)
  40. RSPfont_apostrophe(prefix,t)                (font.rh)
  41. RSPfont_asterisk(prefix,t)                (font.rh)
  42. RSPfont_at(prefix,t)                    (font.rh)
  43. RSPfont_backapostrophe(prefix,t)            (font.rh)
  44. RSPfont_backslash(prefix,t)                (font.rh)
  45. RSPfont_carat(prefix,t)                    (font.rh)
  46. RSPfont_colon(prefix,t)                    (font.rh)
  47. RSPfont_comma(prefix,t)                    (font.rh)
  48. RSPfont_dollar(prefix,t)                (font.rh)
  49. RSPfont_equals(prefix,t)                (font.rh)
  50. RSPfont_exclamation(prefix,t)                (font.rh)
  51. RSPfont_greater(prefix,t)                (font.rh)
  52. RSPfont_left_brace(prefix,t)                (font.rh)
  53. RSPfont_leftb(prefix,t)                    (font.rh)
  54. RSPfont_leftp(prefix,t)                    (font.rh)
  55. RSPfont_less(prefix,t)                    (font.rh)
  56. RSPfont_minus(prefix,t)                    (font.rh)
  57. RSPfont_percent(prefix,t)                (font.rh)
  58. RSPfont_period(prefix,t)                (font.rh)
  59. RSPfont_pipe(prefix,t)                    (font.rh)
  60. RSPfont_plus(prefix,t)                    (font.rh)
  61. RSPfont_pound(prefix,t)                    (font.rh)
  62. RSPfont_question(prefix,t)                (font.rh)
  63. RSPfont_quotes(prefix,t)                (font.rh)
  64. RSPfont_right_brace(prefix,t)                (font.rh)
  65. RSPfont_rightb(prefix,t)                (font.rh)
  66. RSPfont_rightp(prefix,t)                (font.rh)
  67. RSPfont_semicolon(prefix,t)                (font.rh)
  68. RSPfont_slash(prefix,t)                    (font.rh)
  69. RSPfont_tilde(prefix,t)                    (font.rh)
  70. RSPfont_underscore(prefix,t)                (font.rh)
  71. RSPglass(prefix, surf)                    (clean.rh)
  72. RSPglass_holder(prefix, surf)                (clean.rh)
  73. RSPgridobj(prefix,surf)                    (grid.rh)
  74. RSPicosahedron(prefix,surf)                (regsolids.rh)
  75. RSPjewel8pt(prefix,surf)                (jewels.rh)
  76. RSPmounted_jewel8pt(prefix,jewel_surf,bracket_surf)    (jewels.rh)
  77. RSPoctahedron(prefix,surf)                (regsolids.rh)
  78. RSPquadprism(prefix,surf,a,b,c,x,y,z)            (prism.rh)
  79. RSProundedbox(prefix,x1,y1,z1,x2,y2,z2,r)        (rounded.rh)
  80. RSProundedcylinder(prefix,r1,x1,y1,z1,x2,y2,z2,r2)    (rounded.rh)
  81. RSProundeddisc(prefix,r,xp,yp,zp,xn,yn,zn,t)        (rounded.rh)
  82. RSPskyplane(prefix)                    (sky.rh)
  83. RSPskysphere(prefix)                    (sky.rh)
  84. RSPsoap_and_dish(prefix, s_surf, d_surf)        (clean.rh)
  85. RSPsoap_dish(prefix, surf)                (clean.rh)
  86. RSPsoapbar(prefix, surf)                (clean.rh)
  87. RSPtetrahedron(prefix,surf)                (regsolids.rh)
  88. RSPtoothbrush(prefix, surf)                (clean.rh)
  89. RSPtriprism(prefix,surf,x1,z1,x2,z2,x3,z3,y)        (prism.rh)
  90.  
  91.  
  92. Descriptions
  93. ============
  94.     The discriptions are sorted into the object files in which the
  95. superprimitive is defined.  All examples are designed to work with the file
  96. "stdhdr" file which defines a default view and a unit coordinate axis to help
  97. with familiarization with the default placement, size and orientation of the 
  98. various objects.  To test them, append the example to the end of the stdhdr 
  99. file and run rayshade with the path to the rsdefs package defined as in the 
  100. main "Docs" file.  Alternately, you could add the line '#include "stdhdr"' 
  101. right before the example.  The examples will also work with the line 
  102. '#include "defs.rh"' before the example, but will lack the additions in the 
  103. stdhdr file.
  104.  
  105. ------ chess.rh ------
  106.  
  107. RSPchessboard(prefix,s1,s2,sc)
  108.     Creates a flat (i.e. zero "thickness") square chessboard with
  109. surfaces s1 and s2 with edges of length "sc" centered at the origin.
  110.  
  111.     /* Make a red and white chessboard 3 units on a side */
  112.     RSPchessboard(,RSStest_red(),RSStest_white(),3)
  113.  
  114. RSPcylinder_board(prefix,s1,s2,sc)
  115.     Creates a fancy chessboard with cylinders in place of squares
  116. with surfaces s1 and s2 with edges of length "sc" and thickness of .01*sc
  117. with the top surface in the xy-plane centered at x = 0, y = 0.
  118.  
  119.     /* Make a fancy red and white chessboard 3 units on a side */
  120.     RSPcylinder_board(,RSStest_red(),RSStest_white(),3)
  121.  
  122. ------ clean.rh ------
  123.  
  124. RSPtoothbrush(prefix, surf)
  125.     Creates a toothbrush with surface "surf" and white bristles.
  126.  
  127.     /* Make a red plastic toothbrush */
  128.     RSPtoothbrush(,RSSplastic())
  129.         RSMscale(.2)
  130.  
  131. RSPsoapbar(prefix, surf)
  132.     Creates a textured "Irish Spring" soap bar with surface "surf".
  133.  
  134.     /* Make a green bar of soap */
  135.     RSPsoapbar(,RSSsoap_light())
  136.         RSMscale(.2)
  137.  
  138. RSPsoap_dish(prefix, surf)
  139.     Creates a soap dish with surface "surf".
  140.  
  141.     /* Make a pink soap dish */
  142.     RSPsoap_dish(,RSSporcelain_pink())
  143.         RSMscale(.2)
  144.  
  145. RSPsoap_and_dish(prefix, s_surf, d_surf)
  146.     Creates a bar of soap with surface "s_surf" in a soap dish with surface
  147. "d_surf".
  148.  
  149.     /* Make a pink soap dish with a green bar of soap */
  150.     RSPsoap_and_dish(,RSSsoap_light(),RSSporcelain_pink())
  151.         RSMscale(.2)
  152.  
  153. RSPglass(prefix, surf)
  154.     Creates a bumpy textured drinking glass with surface "surf".
  155.  
  156.     /* Make a red plastic glass */
  157.     RSPglass(,RSSplastic())
  158.         RSMscale(.5)
  159.  
  160. RSPglass_holder(prefix, surf)
  161.     Creates a glass holder with surface "surf".  This has an indentation
  162. for a glass in the center and four holes for hanging toothbrushes at each
  163. corner.
  164.  
  165.     /* Make a pink glass holder */
  166.     RSPglass_holder(,RSSporcelain_pink())
  167.         RSMscale(.2)
  168.  
  169. ------ font.rh ------
  170.  
  171. RSPfont_A(prefix,t)
  172.     .
  173.     .
  174.     .
  175. RSPfont_Z(prefix,t)
  176. RSPfont_a(prefix,t)
  177.     .
  178.     .
  179.     .
  180. RSPfont_z(prefix,t)
  181. RSPfont_0(prefix,t)
  182.     .
  183.     .
  184.     .
  185. RSPfont_9(prefix,t)
  186. RSPfont_ampersand(prefix,t)
  187. RSPfont_apostrophe(prefix,t)
  188. RSPfont_asterisk(prefix,t)
  189. RSPfont_at(prefix,t)
  190. RSPfont_backapostrophe(prefix,t)
  191. RSPfont_backslash(prefix,t)
  192. RSPfont_carat(prefix,t)
  193. RSPfont_colon(prefix,t)
  194. RSPfont_comma(prefix,t)
  195. RSPfont_dollar(prefix,t)
  196. RSPfont_equals(prefix,t)
  197. RSPfont_exclamation(prefix,t)
  198. RSPfont_greater(prefix,t)
  199. RSPfont_left_brace(prefix,t)
  200. RSPfont_leftb(prefix,t)
  201. RSPfont_leftp(prefix,t)
  202. RSPfont_less(prefix,t)
  203. RSPfont_minus(prefix,t)
  204. RSPfont_percent(prefix,t)
  205. RSPfont_period(prefix,t)
  206. RSPfont_pipe(prefix,t)
  207. RSPfont_plus(prefix,t)
  208. RSPfont_pound(prefix,t)
  209. RSPfont_question(prefix,t)
  210. RSPfont_quotes(prefix,t)
  211. RSPfont_right_brace(prefix,t)
  212. RSPfont_rightb(prefix,t)
  213. RSPfont_rightp(prefix,t)
  214. RSPfont_semicolon(prefix,t)
  215. RSPfont_slash(prefix,t)
  216. RSPfont_tilde(prefix,t)
  217. RSPfont_underscore(prefix,t)
  218.     Creates "cylinderical" characters.  The character is formed as if a
  219. sphere of radius "t" was swept along the lines and arcs that define the
  220. "base" character.  The base character shapes are defined to be in the xz plane
  221. facing -y enclosed by the square 0,0 to 1,2 in the xz plane.  The lowercase
  222. characters that have lower extensions extend down to z = -0.9.
  223.  
  224.     /* Make a red "A" with thickness of .1 */
  225.     RSPfont_A(name char_A,.1)
  226.     object RSStest_red() char_A
  227.  
  228. ------ grid.rh ------
  229.  
  230. RSPgridobj(prefix,surf)
  231.     Creates an object with surface "surf" that is a grid of very
  232. thin cylinders (small enough to look like lines).  It covers the cube
  233. measured from [0,0,0] to [10,10,10] breaking down the area into unit
  234. cubes.  Useful for tests shots to judge distance and area.
  235.  
  236.     /* Grid the area from -2.0 to 2.0 in all directions */
  237.     RSPgridobj(,RSStest_white())
  238.         RSMscale(0.4)
  239.         translate -2.0 -2.0 -2.0
  240.  
  241. ------ jewels.rh ------
  242.  
  243. RSPjewel8pt(prefix,surf)
  244.     Creates an eight pointed jewel with surface "surf" with the base point
  245. at the origin and the front face at 0,-1,0.
  246.  
  247.     /* Make an emerald */
  248.     RSPjewel8pt(,RSSemerald())
  249.  
  250. RSPmounted_jewel8pt(prefix,jewel_surf,bracket_surf)
  251.     Creates an eight pointed jewel with surface "jewel_surf" held by a
  252. bracket with surface "bracket_surf".  The base point of the jewel is at the
  253. origin and the front face at 0,-1,0 (the bracket extends slightly beyond the
  254. base point -- i.e. the bracket extends slightly into the +y half-space).
  255.  
  256.     /* Make an emerald in a gold bracket */
  257.     RSPmounted_jewel8pt(,RSSemerald(),RSSgold())
  258.  
  259. ------ prisms.rh ------
  260.  
  261. RSPquadprism(prefix,surf,a,b,c,x,y,z)
  262.     Creates a box open on the y faces with given surface "surf".
  263.     (a, b, c) and (x, y, z) are the diametrically opposed corners.
  264.  
  265.     /* Create an open unit box with corners at 0, 0, 0 and 1, 1, 1 */
  266.     RSPquadprism(,RSStest_red(), 0, 0, 0, 1, 1, 1)
  267.  
  268. RSPtriprism(prefix,surf,x1,z1,x2,z2,x3,z3,y)
  269.     Creates a triagular prism of given surface "surf" along the y
  270. axis from y=0 to y="y".  The trio of "x" and "z" pairs denote the
  271. triangle that sweeps out along the y axis to create the prism.
  272.  
  273.     /* Create a right triangle prism going from 0 to 5 in y */
  274.     RSPtriprism(,RSStest_red(), 0.0, 0.0, 1.0, 0.0, 1.0, 1.0, 5.0)
  275.  
  276. ------ regsolids.rh ------
  277.  
  278. RSPtetrahedron(prefix,surf)
  279. RSPcube(prefix,surf)
  280. RSPoctahedron(prefix,surf)
  281. RSPdodecahedron(prefix,surf)
  282. RSPicosahedron(prefix,surf)
  283.     Creates the given unit Platonic Solid with the surface "surf"
  284. centered at [0,0,0].
  285.  
  286.     /* Make a dodecahedron */
  287.     RSPdodecahedron(,RSStest_white())
  288.  
  289. ------ rounded.rh ------
  290.  
  291. RSProundedbox(prefix,x1,y1,z1,x2,y2,z2,r)
  292.     Creates a rounded box with faces at x1,y1,z1,x2,y2,z2 with rounded
  293. edges of radius "r". (This object is compleately enclosed by the box defined
  294. by x1,y1,z1 and x2,y2,z2.)
  295.  
  296.     /* Make a white box from -.5,-.5,-.25 to .5,.5,.25 with rounded edges of radius
  297.         .1 */
  298.     RSProundedbox(name rbox,-.5,-.5,-.25,.5,.5,.25,.1)
  299.     object RSStest_white() rbox
  300.  
  301. RSPboxframe(prefix,x1,y1,z1,x2,y2,z2,r)
  302.     Creates a box frame for a box from x1,y1,z1 to x2,y2,z2 with cylinders
  303. of radius "r". (This object is compleately enclosed by the box defined by
  304. (x1-r),(y1-r),(z1-r) and (x2+r),(y2+r),(z2+r).)
  305.  
  306.     /* Make a white box frame from -1,-1,-1 to 1,1,1 with cylinders of r = .1 */
  307.     applysurf RSStest_white()
  308.     RSPboxframe(,-1,-1,-1,1,1,1,.1)
  309.  
  310. RSProundedcylinder(prefix,r1,x1,y1,z1,x2,y2,z2,r2)
  311.     Creates a cylinder from x1,y1,x2 to x2,y2,z2 of radius r1 with rounded
  312. edges of radius r2.  (This object is compleately enclosed by the cylinder
  313. defined by radius r1 from x1,y1,z1 to x2,y2,z2.)
  314.  
  315.     /* Make a cylinder with surface RSSambulance of radius .5 with ends at
  316.         -1,-2,-1 and 1,2,1 with rounded edges of radius .1 */
  317.     applysurf RSSambulance()
  318.     RSProundedcylinder(,.5,-1,-2,-1,1,2,1,.1)
  319.  
  320. RSProundeddisc(prefix,r,xp,yp,zp,xn,yn,zn,t)
  321.     Creates a "disc" of radius "r" centered at xp,yp,zp with a normal of
  322. xn,yn,zn with rounded edges of radius "t" and thinkness of "t".  (This object
  323. is compleately enclosed by the cylinder defined by radius "r" and the points
  324. (xp,yp,zp)(+,-)(t/2 along the disc normal).)
  325.  
  326.     /* Make a rounded disk with surface RSSambulance of radius 1.5 centered
  327.         at the origin with a normal of 2,-1,2 and a edge radius of .2 */
  328.     applysurf RSSambulance()
  329.     RSProundeddisc(,1.5,0,0,0,2,-1,2,.2)
  330.  
  331. ------ sky.rh -----
  332.  
  333. RSPskyplane(prefix)
  334.     Creates a plane high up in z pointing downwards that has a
  335. sky-like texture on it.  This works well for upward aimed shots.
  336.  
  337.     /* Create a flat sky */
  338.     eyep -3 -30 -10
  339.     RSMdaysky()
  340.     light 1 1 1 point 500 -500 500
  341.     RSPskyplane()
  342.         scale .4 .3 1
  343.  
  344. RSPskysphere(prefix)
  345.     Creates a sphere centered at [0,0,0] of radius 9999.0 with a
  346. sky-like texture on it.  This works well for distance or horizon aimed
  347. shots.
  348.  
  349.     /* Create a curved sky surrounding the origin */
  350.     RSMdaysky()
  351.     light 1 1 1 point 500 -500 500
  352.     RSPskysphere()
  353.  
  354.  
  355.  
  356.  
  357. RSPfont_A(prefix,t)                    (font.rh)
  358. RSPfont_B(prefix,t)                    (font.rh)
  359. RSPfont_C(prefix,t)                    (font.rh)
  360. RSPfont_D(prefix,t)                    (font.rh)
  361. RSPfont_E(prefix,t)                    (font.rh)
  362. RSPfont_F(prefix,t)                    (font.rh)
  363. RSPfont_G(prefix,t)                    (font.rh)
  364. RSPfont_H(prefix,t)                    (font.rh)
  365. RSPfont_I(prefix,t)                    (font.rh)
  366. RSPfont_J(prefix,t)                    (font.rh)
  367. RSPfont_K(prefix,t)                    (font.rh)
  368. RSPfont_L(prefix,t)                    (font.rh)
  369. RSPfont_M(prefix,t)                    (font.rh)
  370. RSPfont_N(prefix,t)                    (font.rh)
  371. RSPfont_O(prefix,t)                    (font.rh)
  372. RSPfont_P(prefix,t)                    (font.rh)
  373. RSPfont_Q(prefix,t)                    (font.rh)
  374. RSPfont_R(prefix,t)                    (font.rh)
  375. RSPfont_S(prefix,t)                    (font.rh)
  376. RSPfont_T(prefix,t)                    (font.rh)
  377. RSPfont_U(prefix,t)                    (font.rh)
  378. RSPfont_V(prefix,t)                    (font.rh)
  379. RSPfont_W(prefix,t)                    (font.rh)
  380. RSPfont_X(prefix,t)                    (font.rh)
  381. RSPfont_Y(prefix,t)                    (font.rh)
  382. RSPfont_Z(prefix,t)                    (font.rh)
  383. RSPfont_a(prefix,t)                    (font.rh)
  384. RSPfont_b(prefix,t)                    (font.rh)
  385. RSPfont_c(prefix,t)                    (font.rh)
  386. RSPfont_d(prefix,t)                    (font.rh)
  387. RSPfont_e(prefix,t)                    (font.rh)
  388. RSPfont_f(prefix,t)                    (font.rh)
  389. RSPfont_g(prefix,t)                    (font.rh)
  390. RSPfont_h(prefix,t)                    (font.rh)
  391. RSPfont_i(prefix,t)                    (font.rh)
  392. RSPfont_j(prefix,t)                    (font.rh)
  393. RSPfont_k(prefix,t)                    (font.rh)
  394. RSPfont_l(prefix,t)                    (font.rh)
  395. RSPfont_m(prefix,t)                    (font.rh)
  396. RSPfont_n(prefix,t)                    (font.rh)
  397. RSPfont_o(prefix,t)                    (font.rh)
  398. RSPfont_p(prefix,t)                    (font.rh)
  399. RSPfont_q(prefix,t)                    (font.rh)
  400. RSPfont_r(prefix,t)                    (font.rh)
  401. RSPfont_s(prefix,t)                    (font.rh)
  402. RSPfont_t(prefix,t)                    (font.rh)
  403. RSPfont_u(prefix,t)                    (font.rh)
  404. RSPfont_v(prefix,t)                    (font.rh)
  405. RSPfont_w(prefix,t)                    (font.rh)
  406. RSPfont_x(prefix,t)                    (font.rh)
  407. RSPfont_y(prefix,t)                    (font.rh)
  408. RSPfont_z(prefix,t)                    (font.rh)
  409. RSPfont_0(prefix,t)                    (font.rh)
  410. RSPfont_1(prefix,t)                    (font.rh)
  411. RSPfont_2(prefix,t)                    (font.rh)
  412. RSPfont_3(prefix,t)                    (font.rh)
  413. RSPfont_4(prefix,t)                    (font.rh)
  414. RSPfont_5(prefix,t)                    (font.rh)
  415. RSPfont_6(prefix,t)                    (font.rh)
  416. RSPfont_7(prefix,t)                    (font.rh)
  417. RSPfont_8(prefix,t)                    (font.rh)
  418. RSPfont_9(prefix,t)                    (font.rh)
  419. RSPfont_backapostrophe(prefix,t)            (font.rh)
  420. RSPfont_minus(prefix,t)                    (font.rh)
  421. RSPfont_equals(prefix,t)                (font.rh)
  422. RSPfont_leftb(prefix,t)                    (font.rh)
  423. RSPfont_rightb(prefix,t)                (font.rh)
  424. RSPfont_backslash(prefix,t)                (font.rh)
  425. RSPfont_semicolon(prefix,t)                (font.rh)
  426. RSPfont_apostrophe(prefix,t)                (font.rh)
  427. RSPfont_comma(prefix,t)                    (font.rh)
  428. RSPfont_period(prefix,t)                (font.rh)
  429. RSPfont_slash(prefix,t)                    (font.rh)
  430. RSPfont_tilde(prefix,t)                    (font.rh)
  431. RSPfont_exclamation(prefix,t)                (font.rh)
  432. RSPfont_at(prefix,t)                    (font.rh)
  433. RSPfont_pound(prefix,t)                    (font.rh)
  434. RSPfont_dollar(prefix,t)                (font.rh)
  435. RSPfont_percent(prefix,t)                (font.rh)
  436. RSPfont_carat(prefix,t)                    (font.rh)
  437. RSPfont_ampersand(prefix,t)                (font.rh)
  438. RSPfont_asterisk(prefix,t)                (font.rh)
  439. RSPfont_leftp(prefix,t)                    (font.rh)
  440. RSPfont_rightp(prefix,t)                (font.rh)
  441. RSPfont_underscore(prefix,t)                (font.rh)
  442. RSPfont_plus(prefix,t)                    (font.rh)
  443. RSPfont_left_brace(prefix,t)                (font.rh)
  444. RSPfont_right_brace(prefix,t)                (font.rh)
  445. RSPfont_pipe(prefix,t)                    (font.rh)
  446. RSPfont_colon(prefix,t)                    (font.rh)
  447. RSPfont_quotes(prefix,t)                (font.rh)
  448. RSPfont_less(prefix,t)                    (font.rh)
  449. RSPfont_greater(prefix,t)                (font.rh)
  450. RSPfont_question(prefix,t)                (font.rh)
  451.